﻿using System;
using log4net;
using System.IO;
using log4net.Config;

namespace CzfSDK
{
	public class CzfLog_Log4Net:CzfLog
	{
		//log4net日志专用
		private static ILog _loginfo;
		private static ILog _logerror;

		public CzfLog_Log4Net (string configPath)
		{
			FileInfo fi = new FileInfo (configPath);
			//			XmlConfigurator.ConfigureAndWatch (fi);
			XmlConfigurator.Configure (fi);
			_loginfo = LogManager.GetLogger("loginfo");
			_logerror = LogManager.GetLogger("logerror");

			CzfLog.current = this;
		}

		protected override void CInfo(object msg)
		{
			_loginfo.Info (msg);
		}

		protected override void CError(object msg, Exception e)
		{
			_logerror.Error (msg, e);
		}
	}
}

